package com.sqx.modules.health.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.health.common.RoleEnum;
import com.sqx.modules.health.dto.UserDTO;
import com.sqx.modules.health.dto.UserPasswordDTO;
import com.sqx.modules.health.entity.Agent;
import com.sqx.modules.sys.entity.SysUserEntity;
import com.sqx.modules.health.entity.UserDevice;

import java.util.List;

/**
 * <p>
 * 用户信息	 服务类
 * </p>
 *
 * @author gxy
 * @since 2022-04-14
 */
public interface IUserService extends IService<SysUserEntity> {

    UserDTO login(UserDTO userDTO);

    SysUserEntity appPatientLogin(SysUserEntity user);
    Result appLoginByHealth(SysUserEntity user);

    SysUserEntity appPatientRegister(SysUserEntity user);

    SysUserEntity register(UserDTO userDTO);

    boolean updatePassword(UserPasswordDTO userPasswordDTO);

    SysUserEntity findRole(Long loginId, RoleEnum roleUser);

    SysUserEntity findByOpenid(String openid);

    SysUserEntity findByPhone(String phone);

    SysUserEntity findByUid(String uid);

    SysUserEntity findByToken(String token);

    SysUserEntity searchUser(String openid);

    void updateToken(SysUserEntity user);

    List<UserDevice> getUserDevice(Long id);

    void UserUnBinding(Long uid, Long deviceid);

    List<Agent> findAllOperation(String uid, Long id);

    List<String> getResult(Long hid);

    boolean update(SysUserEntity entity);

    @Override
    boolean updateById(SysUserEntity entity);

    @Override
    boolean saveOrUpdate(SysUserEntity entity);

    SysUserEntity getRedisByUid(String uid);

    SysUserEntity getRedisByUid(Long uid);
}
